﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.Mirror.CliMetadata.DebugInfo
{
	public class SymMethodBuilder
	{
		internal SymMethodBuilder(int token, int msilLength)
		{
			this.Token = token;
			this.RootScope = new SymMethodScopeBuilder(0, msilLength);
			this.sequencePoints = new SortedList<int, SymSequencePointBuilder>();
		}

		public int Token { get; private set; }

		public SymMethodScopeBuilder RootScope { get; private set; }

		internal SortedList<int, SymSequencePointBuilder> sequencePoints;
		public void DefineSequencePoint(
			int cilOffset,
			int sourceStartLine,
			int sourceStartColumn,
			int sourceEndLine,
			int sourceEndColumn
			)
		{
			SymSequencePointBuilder sequencePoint = new SymSequencePointBuilder(
				cilOffset,
				sourceStartLine,
				sourceStartColumn,
				sourceEndLine,
				sourceEndColumn
				);
			this.sequencePoints.Add(cilOffset, sequencePoint);
		}
	}
}
